﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="smsMessageList.aspx.cs" ValidateRequest="false"
    Inherits="PeisongWeb.admin.smsMessageList" %>

<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>短信群发 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->

    <script src="scripts/Phonenumbercheeck.js" type="text/javascript"></script>
    <script type="text/javascript">
        function resetSrh() {
            document.getElementById('ext_StartInputDt').value = "";
            document.getElementById('ext_EndInputDt').value = "";
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server" ID="ResourceManager1" />
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            短信列表
        </h2>
        <span style="<%=power>=2?"": "display:none" %>">
            <ext:Button runat="server" ID="btnNewMessage" Icon="Add" Text="新建短信" AutoPostBack="True" CausesValidation="false"
                OnClick="btnNewMessage_Click">
            </ext:Button>
        </span>
        <p>
            &nbsp;&nbsp;</p>
        <asp:UpdatePanel runat="server" ID="smsMessagePanel">
            <ContentTemplate>
                <ext:Panel ID="Panel1" runat="server" Title="搜索" BodyStyle="padding:5px 5px 0" Width="1120px"
                    Frame="true" ButtonAlign="Center">
                    <Body>
                        <div id="admin_edit_content_search">
                            <ul>
                                <li style="width: 162px">
                                    <label>订单日期</label>
                                    <ext:DateField ID="ext_StartInputDt" runat="server" AllowBlank="true" ReadOnly="true" Width="100" />
                                </li>
                                <li style="width: auto">
                                    <label style="width: 25px">至</label>
                                    <ext:DateField ID="ext_EndInputDt" ReadOnly="true" runat="server" Width="100" />
                                </li>
                                <li style="width: auto; padding-right: 150px">
                                    <label>&nbsp;</label>
                                    <asp:LinkButton ID="lbtn_Search" runat="server" CausesValidation="false" Text="[搜 索]" OnClick="lbtn_Search_Click"></asp:LinkButton>
                                    &nbsp;&nbsp;&nbsp;<a href="javascript:resetSrh();">[重 置]</a></li>
                                </li>
                            </ul>
                        </div>
                    </Body>
                </ext:Panel>
                <p>
                    &nbsp;&nbsp;</p>
                <div id="admin_list_content" style="width: 1120px;">
                    <table cellpadding="0" cellspacing="0">
                        <tr class="header-row">
                            <th>
                                发送时间
                            </th>
                            <th>
                                电话号码
                            </th>
                            <th>
                                内 容
                            </th>
                            <th>
                                状 态
                            </th>
                            <th>
                                地址
                            </th>
                            <th>
                                发送人
                            </th>
                            <th>
                                详细信息
                            </th>
                        </tr>
                        <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_list_ItemCommand">
                            <ItemTemplate>
                                <tr class='<%# Container.ItemIndex%2==0? "alt":"row-alt"  %>'>
                                    <td>
                                        <%# Eval("tim")%>
                                    </td>
                                    <td>
                                        <%# Eval("phns").ToString().Length > 15 ? Eval("phns").ToString().Substring(0,15) + "..." : Eval("phns").ToString()%>
                                    </td>
                                    <td>
                                        <%# Eval("cont").ToString().Length > 15 ? Eval("cont").ToString().Substring(0, 15) + "..." : Eval("cont").ToString()%>
                                    </td>
                                    <td>
                                        <%# Eval("flag").ToString()=="1"?"已发送":"未发送"%>
                                    </td>
                                    <td>
                                        <%# Eval("url")%>
                                    </td>
                                    <td>
                                        <%# Eval("adminId").ToString()=="0"||Eval("adminId").ToString()==""?"系统发送":logic.sysAdmin.getById(Convert.ToInt32(Eval("adminId"))).Username%>
                                    </td>
                                    <td>
                                        <asp:LinkButton ID="lbl_View" runat="server" CausesValidation="false" CommandName="View" CommandArgument='<%# Eval("id") %>' Text="详细信息">
                                        </asp:LinkButton>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                    <div id="page">
                        <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                            OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="50"
                            InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                            ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                            CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                            LastPageText="末页" PrevPageText="上一页">
                        </webdiyer:AspNetPager>
                    </div>
                </div>
                <ext:Window ID="errorDetails" runat="server" Title="短信日志详细信息" Width="600px" Height="300px"
                    BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="True"
                    Resizable="false" ShowOnLoad="false" Draggable="false" Icon="ApplicationViewDetail">
                    <Body>
                        <div id="admin_edit_content">
                            <ul>
                                <li>
                                    <label for="name" style="text-align: right;">
                                        编号：</label>
                                    <asp:Literal ID="lbl_id" runat="server"></asp:Literal>
                                </li>
                                <li>
                                    <label for="name" style="text-align: right;">
                                        发送时间：</label>
                                    <asp:Literal ID="lbl_tim" runat="server"></asp:Literal>
                                </li>
                                <li>
                                    <label for="name" style="text-align: right;">
                                        电话号码：</label>
                                    <asp:Literal ID="lbl_phns" runat="server"></asp:Literal>
                                </li>
                                <li>
                                    <label for="name" style="text-align: right;">
                                        内 容：</label>
                                    <div style="float: right; width: 470px; color: Red;">
                                        <asp:Literal ID="lbl_cont" runat="server"></asp:Literal>
                                    </div>
                                </li>
                                <li>
                                    <label for="name" style="text-align: right;">
                                        状 态：</label>
                                    <asp:Literal ID="lbl_flag" runat="server"></asp:Literal>
                                </li>
                                <li>
                                    <label for="name" style="text-align: right;">
                                        Url：</label>
                                    <asp:Literal ID="lbl_Url" runat="server"></asp:Literal>
                                </li>
                            </ul>
                        </div>
                    </Body>
                </ext:Window>
                <ext:Window ID="winMessage" runat="server" Title="新建短信" Width="720px" Height="500px"
                    BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="True"
                    Resizable="false" ShowOnLoad="false" Draggable="false" Icon="ApplicationViewDetail">
                    <Body>
                        <div id="admin_edit_content">
                            <ul>
                                <li style="color: Red;">
                                    <label>
                                        提示： *
                                    </label>
                                    群发短信手机号码用","分开。如：152********,13678******,135******** </li>
                                <li>
                                    <label>
                                        手机号码 *
                                    </label>
                                    <asp:TextBox runat="server" ID="txt_Phones" TextMode="MultiLine" Width="500" Height="100"
                                        onkeyup="CheckComma();"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="请录入手机号码"
                                        ControlToValidate="txt_Phones" Display="Dynamic"></asp:RequiredFieldValidator>
                                </li>
                                <li>
                                    <label>
                                        短信内容 *
                                    </label>
                                    <asp:TextBox runat="server" ID="txt_Content" TextMode="MultiLine" Width="500" Height="200"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请录入短信内容"
                                        ControlToValidate="txt_Content" Display="Dynamic"></asp:RequiredFieldValidator>
                                </li>
                                <li>
                                    <label>
                                        &nbsp;
                                    </label>
                                    <span style='<%=power>=2?"": "display:none" %>'>
                                        <asp:Button runat="server" ID="btn_Save" OnClientClick="return CheckNum();" Text="发送短信"
                                            OnClick="btn_Save_Click" />
                                    </span></li>
                            </ul>
                        </div>
                    </Body>
                </ext:Window>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
